package com.itheima.up_web.singlerow;

import cn.itcast.up.common.HdfsTools;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class Singleton {
    private static class SingleHorder{
        private static final Singleton INSTANCE = new Singleton();
    }

    private Singleton(){};

    public static Singleton getInstance(){
        return SingleHorder.INSTANCE;
    }


    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        /*Singleton singleton = Singleton.getInstance();
        Constructor<Singleton> declaredConstructor = Singleton.class.getDeclaredConstructor();
        declaredConstructor.setAccessible(true);
        Singleton singleton1 = declaredConstructor.newInstance();
        System.out.println(singleton == singleton1);
        SingletonEnum instance = SingletonEnum.INSTANCE;
        SingletonEnum instance1 = SingletonEnum.INSTANCE;
        System.out.println(instance == instance1);
        instance.get();*/
        HdfsTools.build().uploadLocalFile2HDFS("a.jar","hdfs://cluster1/tmp/d6bf0d0b-fe66-4543-bfcc-d872bcaf2f94.jar");
    }
}
